

FROM openjdk:8-jdk
LABEL MAINTAINER="liyx <liyxzsu@gmail.com>"

# change debian source mirror
COPY sources.list /etc/apt/sources.list
# Install a basic SSH server
RUN apt-get update
RUN apt-get remove -y openssh-client
RUN apt-get remove -y openssh-sftp-server
RUN apt-get install --no-install-recommends -y openssh-server
RUN apt-get clean
RUN sed -i 's|session    required     pam_loginuid.so|session    optional     pam_loginuid.so|g' /etc/pam.d/sshd
RUN mkdir -p /var/run/sshd

# Add user jenkins to the image
RUN adduser --quiet jenkins
# Set password for the jenkins user (you may want to alter this).
RUN echo "jenkins:jenkins" | chpasswd

RUN mkdir /home/jenkins/.m2

RUN chown -R jenkins:jenkins /home/jenkins/.m2/ 

RUN apt-get install -y maven
# Standard SSH port
EXPOSE 22

CMD ["/usr/sbin/sshd", "-D"]